<div class="footer">Copyright © 2014  La Luna Events All Rights Reserved. <br>  <a href="http://www.miitbeian.gov.cn">闽ICP备14006999号</a></div>
<style type="text/css">
.pop-box { box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); width: 408px; z-index: 90; text-align: left; border-radius: 8px; -webkit-border-radius: 8px; }
.pop-main { background-color: #FFFFFF; border: 1px solid #BBBBBB; border-radius: 8px; -webkit-border-radius: 8px; }
.pop-main .pop-hd { background-color: #F4F4F4; padding: 8px 10px; position: relative; border-top-left-radius: 8px; border-top-right-radius: 8px; -webkit-border-top-left-radius: 8px; -webkit-border-top-right-radius: 8px; }
.pop-main .pop-hd h3 { color: #424242; font-size: 14px; }
.pop-main .pop-hd .close { background: url(${rc.getContextPath()}/front/images/box_close.gif); height: 13px; position: absolute; right: 8px; top: 10px; width: 11px; z-index: 2; }
label.fieldError2 {line-height: 23px;color: #ffb042;padding-left: 6px;margin: 12px 0 0 180px;}
</style>
<div class="pop-box Hide" style="width: 408px; height: auto; z-index: 2300; top:180px; left: 479px; position:absolute;">
  <div class="pop-main">
    <div class="pop-hd">
      <h3>Sign in</h3>
      <a class="close" title="" href="#" onClick="hidepopbox()"></a> </div>
    <div class="leftSideLogin" style="margin:20px auto;width:408px;float:none;">
      <div class="loginOption">
        <form style="margin-left: 60px;" name="loginForm" id="loginForm"> 
          <p>
            <input type="text" name="loginName" id="txtLoginName" class="login username" onkeydown="pwdKey(event)"/>
          </p>
          <p class="loginHint">User name and password are case sensitive</p>
          <p>
            <input type="password" name="password" id="txtPassword" class="login password" onkeydown="pwdKey(event)"/>
          </p>
          <p class="loginHint"><!--Forgot your <a href="#">password?</a>--></p>
          <input type="button" class="loginimage" border="0" value="Sign In" onclick="login()"/>
        </form>
      </div>
    </div>
  </div>
</div>
  <script type="text/javascript">
	function showpopbox() {
	    $(".pop-box").removeClass("Hide");
	}
	function hidepopbox() {
	    $(".pop-box").addClass("Hide");
	}
	$("#loginForm").validate({
		errorClass : "fieldError2",
		rules : {
			loginName: "required",
			password: "required"
		}
	});
	function pwdKey(ev) {
		if (ev.keyCode == 13) {
			login();
		}
	}
	function login() {
		var isValid = $("#loginForm").valid();
		if (isValid) {
			var loginName = document.getElementById("txtLoginName").value;
			var password = document.getElementById("txtPassword").value;
			if (password && loginName) {
				ajaxLoginIn(loginName,password);
			}
		}
	}
	
	function ajaxLoginIn(loginName, password) {
		$.ajax({
			type: "POST",
		    dataType: "json",
		    url: "${base!}/ajaxLoginIn.html",
		    data: { "loginName": loginName, "password": password },
		    success: function(json) {
		        if (json.msg == "true") {
					window.location.reload();
		        } else if (json.msg == "wrong") {
		            alert('Invalidate username or password!');
		        } else if (json.msg.indexOf("id=")==0) {
		        	location.href = "${base!}/front/membervalid.html?memberId="+json.msg.substring(3);
		        }
		    },
		    error: function() {
		        alert('System error!');
		    }
		});
	}
	
	function ajaxLoginOut(loginName, password) {
		if (window.confirm("Are you sure to loginOut?")) {
			$.ajax({
				type: "POST",
			    dataType: "json",
			    url: "${base!}/ajaxLoginOut.html",
			    data: { },
			    success: function(json) {
			        if (json.msg == "true") {
						window.location.reload();
			        } else {
			            alert(json.msg);
			        }
			    },
			    error: function() {
			        alert('System error!');
			    }
			});
		}
	}
	
	function showPersonalInfo() {
		location.href = "${base!}/front/personal.html";
	}
</script>